{{template "header"}}
<title>文章 - 我的 beego 博客</title>
</head>

<body>
<div class="navbar navbar-default navbar-fixed-top">
    <div class="container">
        {{template "navbar" .}}
    </div>
</div>

<div class="container">
    <h1>文章列表</h1>
    <a type="submit" class="btn btn-default" href="/topic/add">添加文章</a>
    <table class="table table-striped">
        <thead>
        <tr>
            <th>#</th>
            <th>标题</th>
            <th>更新时间</th>
            <th>浏览数</th>
            <th>回复数</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {{range .Topics}}
        <tr>
            <th>{{.Id}}</th>
            <th><a href="/topic/view/{{.Id}}">{{.Title}}</a></th>
            <th>{{.Updated}}</th>
            <th>{{.Views}}</th>
            <th>{{.ReplyCount}}</th>
            <th>
                <a href="/topic/modify?tid={{.Id}}">修改</a>
                <a href="/topic/delete?tid={{.Id}}">删除</a>
            </th>
        </tr>
        {{end}}
        </tbody>
    </table>
</div>

<script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</body>
</html>